package cn.com.computer.my.computer.music.service.bo.enums;

/**
 * Created by WANGXin on 2017/5/18.
 */
public enum MusicAuthorEnum {
    ASANG("ASANG","阿桑"),
    HUGE("HUGE","胡歌"),
    LISHENGJI("LISHENGJIE","李圣杰"),
    LIUDEHUA("LIUDEHUA","刘德华"),
    LUODAYOU("LUODAYOU","罗大佑"),
    PANWEIBO("PANWEIBO","潘玮柏"),
    XUSONG("XUSONG","许嵩"),
    XUYUTENG("XUYUTENG","徐誉滕"),
    ZHOUHUAJIAN("ZHOUHUAJIAN","周华健"),
    ZHOUJIELUN("ZHOUJIELUN","周杰伦");

    private String code;
    private String desc;

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static String getName(String code) {
        if (code == null) {
            return null;
        }
        for (MusicAuthorEnum e : MusicAuthorEnum.values()) {
            if (e.getCode().equals(code)) {
                return e.getDesc();
            }
        }
        return null;
    }
    public static String getValue(String desc) {
        if (desc == null) {
            return null;
        }
        for (MusicAuthorEnum e : MusicAuthorEnum.values()) {
            if (e.getDesc().equals(desc)) {
                return e.getCode();
            }
        }
        return null;
    }

    MusicAuthorEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }
}
